var webpack = require('webpack'),
	path = require('path');
var commonsChunkPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');

module.exports = {
		entry:{
			index:[
			'webpack-dev-server/client?http://localhost:8090/',//资源服务器地址
   			'webpack/hot/only-dev-server',
			'./public/index.js'
		]},
		output:{
			publicPath: "http://localhost:8090/",
			path:__dirname+'/dist/',
			filename:'[name].entry.js'
		},
		module:{
			// noParse:[path.join(__dirname,'/node_modules/react/dist/react.min'),path.join(__dirname,'/node_modules/react-dom/dist/react-dom.min'),
			// 		path.join(__dirname,'/node_modules/react-router/umd/ReactRouter.min')],
			loaders:[
				{
					test:/\.js$/,
					exclude:/node_modules/,
					include:[path.resolve(__dirname,'public')],
					//path.resolve(__dirname,'public'),
					loader:'react-hot!babel-loader',//!jsx-loader?harmony
					//query:{presets:['es2015']}
				},
				{
					test:/\.css$/,
					loader:"style-loader!css-loader"
				},
				{ 
					test: /\.(png|jpg)$/, 
					loader: "url?limit=2500" 
				},
           		{
           			test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, 
           			loader: "url?limit=10000&mimetype=application/font-woff"
           		},
            	{
            		test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, 
            		loader: "url?limit=10000&mimetype=application/font-woff2"
            	},
            	{
            		test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, 
            		loader: "url?limit=10000&mimetype=application/octet-stream"
            	},
            	{
            		test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, 
            		loader: "file"
            	},
            	{
            		test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, 
            		loader: "url?limit=10000&mimetype=image/svg+xml"
            	}
			]
		},
		resolve:{
			alias:{
				// 'react':'react/dist/react.min.js',
				'react-dom':'react-dom/dist/react-dom.min.js',
				'react-router':'react-router/umd/ReactRouter.min.js',
				'jqueryui':'jquery-ui-bootstrap/jquery.ui.theme.css',
				'jqueryuifont':'jquery-ui-bootstrap/jquery.ui.theme.font-awesome.css',
				'jplayer':'jplayer/dist/jplayer/jquery.jplayer.min.js',
				'bootstrapjs':'bootstrap/dist/js/bootstrap.min.js',
				'simditorjs':'simditor/lib/simditor.js',
				'simditorcss':'simditor/styles/simditor.css',
				'fontAwesome':'font-awesome/css/font-awesome.min.css'
			},
			modulesDirectories:["node_modules","lib"]
		},
		plugins:[
			commonsChunkPlugin,
			new webpack.ProvidePlugin({
				$:"jquery",
				jQuery:"jquery",
				_:"lodash"

			}),
			new webpack.DefinePlugin({
				VERSION:"1.0",
				'process.env.NODE_ENV': '"development"'
			}),
			new webpack.HotModuleReplacementPlugin()
		],
		//dev settings 
		stats:{
			colors:true,
			modules:true,
			reasons:true,
			profile:true
		},
	//	watch:true,
		devtool:'source-map'

};